<include file="public@header"/>
</head>
<body>
<style>
    .list-img{
        width: 60px;
        height: auto;
    }
</style>

<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('ceping/index')}">所有测评任务</a></li>
        <li><a href="{:url('ceping/add')}">添加测评任务</a></li>
    </ul>

    <form action="" style="padding: 15px;padding-bottom: 0;" method="post">
        <label for="category">
            <select class="form-control" name="category_id" id="category">
                <option  value="0">全部分类</option>
                <volist name="categories" id="v">
                    <option {$category_id== $v.id ?'selected':''} value="{$v.id}">{$v.name}</option>
                </volist>
            </select>
        </label>
        <button type="submit" class="btn btn-info">搜索</button>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('Link/listOrder')}">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th>任务名称</th>
                <th>所属分类</th>
                <th>任务佣金</th>
                <th>任务图片</th>
                <th>任务链接</th>
                <th>所属店铺</th>
                <th>店铺截图</th>
                <th>所需测评</th>
                <th width="120">备注</th>
                <th width="50">{:lang('STATUS')}</th>
                <th>创建时间</th>
                <th width="120">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="cepings" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.product_name}</td>
                    <td>{$vo.category}</td>
                    <td>{$vo.commission_type.' '.$vo.commission}</td>
                    <td>
                        <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo['product_image'])}');">
                            <img class="list-img" src="{:cmf_get_image_url($vo.product_image)}" alt="">
                        </a>

                    </td>
                    <td><a class="btn btn-info" target="_blank" href="{$vo.product_link}">查看商品</a></td>
                    <td>{$vo.shop_name}</td>
                    <td>
                        <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo['shop_image'])}');">
                            <img class="list-img" src="{:cmf_get_image_url($vo.shop_image)}" alt="">
                        </a>
                    </td>
                    <td>{$vo.need_num}</td>
                    <td>{$vo.remark}</td>
                    <td>{$vo.status?'可用':'禁用'}</td>
                    <td>{:date('Y-m-d H:i',$vo.create_time)}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('ceping/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger" onclick="del('{:url(\'ceping/delete\',array(\'id\'=>$vo[\'id\']))}')" href="javascript:;">
                            {:lang('DELETE')}
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>

<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script type="text/javascript">
    function del(url){
        layer.confirm('删除后不可撤回，确定要删除吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            window.location.href = url;
        });
    }
</script>
</body>
</html>
